package com.htc.android.footprints.commonui;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Rect;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.TouchDelegate;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.TextView;

import com.htc.android.footprints.vo.Footprint;

public class ImportDialog extends Activity
  implements View.OnClickListener
{
  private static final String TAG = "ImportDialog";
  private boolean isClicked = false;
  private Button mBtnCancel;
  private Button mBtnNo;
  private Button mBtnYes;
  private CheckBox mChkApplyAll;
  private TextView mDialogContent;
  private Footprint mImportData;
  private TextView mTextApplyAll;

  private Intent getCancelIntent()
  {
    Intent localIntent = new Intent();
    localIntent.putExtra("isCancelImport", true);
    return localIntent;
  }

  public void onClick(View paramView)
  {
    Intent localIntent = new Intent();
    if (paramView == this.mBtnCancel)
    {
      localIntent.putExtra("isCancelImport", true);
      localIntent.putExtra("isWaitDialog", false);
      this.isClicked = true;
      if (!this.mChkApplyAll.isChecked())
        break label109;
    }
    label109: for (boolean bool = true; ; bool = false)
    {
      localIntent.putExtra("isApplyAll", bool);
      setResult(-1, localIntent);
      finish();
      return;
      if (paramView == this.mBtnNo)
      {
        localIntent.putExtra("isOverwrite", 2);
        break;
      }
      if (paramView != this.mBtnYes)
        break;
      localIntent.putExtra("isOverwrite", 1);
      break;
    }
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    this.mImportData = ((Footprint)getIntent().getParcelableExtra("import_data"));
    setContentView(2130903059);
    this.mDialogContent = ((TextView)findViewById(2131492972));
    this.mBtnCancel = ((Button)findViewById(2131492977));
    this.mBtnNo = ((Button)findViewById(2131492976));
    this.mBtnYes = ((Button)findViewById(2131492975));
    this.mBtnCancel.setOnClickListener(this);
    this.mBtnNo.setOnClickListener(this);
    this.mBtnYes.setOnClickListener(this);
    this.mChkApplyAll = ((CheckBox)findViewById(2131492973));
    this.mChkApplyAll.setChecked(false);
    this.mTextApplyAll = ((TextView)findViewById(2131492974));
    this.mTextApplyAll.setTouchDelegate(new TouchDelegate(new Rect(0, 0, 100, 50), this.mChkApplyAll));
    String str = getResources().getString(2131361932) + "\" " + this.mImportData.mName + "\"?";
    this.mDialogContent.setText(str);
  }

  public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  {
    if (paramInt == 4)
    {
      setResult(-1, getCancelIntent());
      this.isClicked = true;
      finish();
    }
    for (boolean bool = true; ; bool = super.onKeyDown(paramInt, paramKeyEvent))
    {
      return bool;
      if (((paramInt != 19) && (paramInt != 20) && (paramInt != 21) && (paramInt != 22)) || (this.mChkApplyAll.isFocusable()))
        continue;
      this.mChkApplyAll.setFocusable(true);
      this.mBtnYes.setFocusable(true);
      this.mBtnNo.setFocusable(true);
      this.mBtnCancel.setFocusable(true);
    }
  }

  protected void onPause()
  {
    super.onPause();
    if (!this.isClicked)
    {
      setResult(-1, getCancelIntent());
      finish();
    }
  }

  protected void onResume()
  {
    super.onResume();
  }
}

/* Location:           E:\workspace\dex2java\dex-translator-0.0.9.3\HtcFootprints_dex2jar.jar
 * Qualified Name:     com.htc.android.footprints.commonui.ImportDialog
 * JD-Core Version:    0.6.0
 */